import request from '@/utils/request'

// 查询项目基本信息列表
export function listProject(query) {
    return request({
        url: '/departmentWaterResources/project/list',
        method: 'get',
        params: query
    })
}

// 查询项目基本信息详细
export function getProject(id) {
    return request({
        url: '/departmentWaterResources/project/' + id,
        method: 'get'
    })
}

// 新增项目基本信息
export function addProject(data) {
    return request({
        url: '/departmentWaterResources/project/addOrUpdateBasicInfo',
        method: 'post',
        data: data
    })
}

// 新增项目概况
export function addOrUpdateProjectOverview(data) {
    return request({
        url: '/departmentWaterResources/project/addOrUpdateProjectSituation',
        method: 'post',
        data: data
    })
}
// 获取项目概况
export function projectSituation(id) {
    return request({
        url: '/departmentWaterResources/project/projectSituation/' + id,
        method: 'get'
    })
}

// 修改项目基本信息
export function updateProject(data) {
    return request({
        url: '/departmentWaterResources/project',
        method: 'put',
        data: data
    })
}

// 删除项目基本信息
export function delProject(id) {
    return request({
        url: '/departmentWaterResources/project/' + id,
        method: 'delete'
    })
}
// 获取项目编码
export function getCode() {
    return request({
        url: '/departmentWaterResources/project/getCode',
        method: 'get'
    })
}

// 获取项目立项依据详细信息
export function projectApplication(query) {
    return request({
        url: '/departmentWaterResources/basis/list',
        method: 'get',
        params: query
    })
}


// 新增项目立项依据
export function projectApplicationAddOrUpdate(data) {
    return request({
        url: '/departmentWaterResources/basis/addOrUpdate',
        method: 'post',
        data: data
    })
}

// 查询项目主要技术成果列表
export function getKeyAchievements(query) {
    return request({
        url: '/departmentWaterResources/keyAchievements/list',
        method: 'get',
        params: query
    })
}

// 查询项目主要技术成果列表
export function getFinalAchievements(query) {
    return request({
        url: '/departmentWaterResources/finalAchievements/list',
        method: 'get',
        params: query
    })
}

// 预期研究主要技术 新增或修改
export function achievementsAddOrUpdate(data) {
    return request({
        url: '/departmentWaterResources/finalAchievements/addOrUpdate',
        method: 'post',
        data: data
    })
}


export function getFile(query) {
    return request({
        url: '/departmentWaterResources/resource/list',
        method: 'get',
        params: query
    })
}

export function addOrUpdateFile(data) {
    return request({
        url: '/departmentWaterResources/project/addOrUpdateFile',
        method: 'post',
        data: data
    })
}
